package com.swgk.core.recyclerview.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.graphics.Typeface;
import android.widget.TextView;

import com.swgk.core.BR;
import com.swgk.core.R;
import com.swgk.core.recyclerview.entity.BaseAreaEntity;

import java.util.List;

public class BaseAreaAdapter extends BaseRecycleAdapter<BaseAreaEntity> {
    boolean isShowSimple;

    public void setShowSimple(boolean showSimple) {
        isShowSimple = showSimple;
    }
    public BaseAreaAdapter(Context context, List<BaseAreaEntity> datas, int tag) {
        super(context, tag, datas);

    }

    @Override
    public void convert(ItemViewHolder holder, final BaseAreaEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        TextView tvName=holder.getItem().findViewById(R.id.tv_name);
//        if(isShowSimple){
        tvName.setText(TextUtils.isEmpty(entity.getSimpleName()) ? entity.getName() : entity.getSimpleName());
  /*      }else{
            tvName.setText(entity.getName());
        }*/
        if (holder.getItem().isSelected()) {
            tvName.getPaint().setFakeBoldText(true);
        } else {
            tvName.getPaint().setFakeBoldText(false);
        }
    }
}
